import { Row, Col, Table, Button } from 'antd';
import {connect } from 'dva';
// import styles from './Show.less';
import ReactEcharts from 'echarts-for-react';
import echarts from 'echarts';
import Pie from './Pie';
import Bar from './Bar';
import Line from './Line';
import Query from './Query';


function Performant ({data}) {
  const { performant, } = data;

//在设置固定列时，若列头与内容不对齐或出现列重复，请指定列的宽度 width.
//建议指定 scroll.x 为大于表格宽度的固定值或百分比。注意，且非固定列宽度之和不要超过 scroll.x。
//可以不设置最后一列的宽来解决列宽之和与scroll.x不匹配而出现的不对齐问题。
  const columns = [
    {
      title:'区域',
      dataIndex:'area',
      key:'area',
      width:300
    }, {
      title:'公司',
      dataIndex:'company',
      key:'company',
      width:320
    }, {
      title:'月份',
      dataIndex:'data_month',
      key:'data_month',
      width:300

    }, {
      title:'数据',
      dataIndex:'record',
      key:'record',
      width:300
    }, {
      title:'备注',
      dataIndex:'remarks',
      key:'remarks',

    },
  ]

  // const xLabel = ['一', '二', '三', '四', '五', '六', '七', '八', '九']
  // const value = [1, 2, 4, 8, 16, 32, 64, 128, 256]
  // const title = '对数轴示例'
  // const name = '数据名称'
  // const line = {xLabel,value,title,name}
  return (
    <div >
      <Query onOk={{}}/>
      <div style={{height: '70vh'}}>
        <Row>
          <Col span={20}>
            <Line data={performant}/>
          </Col>
        </Row>
      </div>

      <Table
        columns={columns}
        dataSource={performant}
        rowKey={record => record.id}
        scroll={{x:2400,y:'calc(100vh - 120px)'}}
        size={'small'}
        pagination={false}
        // pagination={{
        //   // showSizeChanger: true,
        //   showQuickJumper: true,
        //   showTotal: total => `共 ${total} 条`,
        //   // pageSizeOptions:['5','10','15','20'],
        //   defaultPageSize:5,
        // }}

      />
    </div>
  )
}

export default connect(({data})=>({data}))(Performant);
